//
// Created by 吴锐 on 2022/2/24.
//

#include "iostream"

using namespace std;

class Person {
public:
    int m_Age;

public:
    Person(){
        cout << "Person的无参构造调用" << endl;
    }

    Person(int age){
        cout << "Person的有参构造调用" << endl;
        m_Age = age;
    }

    Person(const Person& person){
        cout << "Person的拷贝构造调用" << endl;
        m_Age = person.m_Age;
    }

    ~Person(){
        cout << "Person的析构函数调用" << endl;
    }

};

void test01(){
    Person p1(20);
    Person p2(p1);

    cout << "p2的年龄为多少: " << p2.m_Age << endl;
}

void doWork(Person p){

}

void test02(){
    Person p;
    doWork(p);
}

Person doWork02(){
    Person p1;
    cout << (int*)&p1 << endl;
    return p1;
}

void test03(){
    Person p = doWork02();
    cout << (int*)&p << endl;
}

int main(){
//    test01();

    test02();
    return 0;
}